import "package:flutter/cupertino.dart";

class CheckInInfoState extends InheritedWidget {
  const CheckInInfoState({
    super.key,
    required this.info,
    required this.mainRenter,
    required this.cohabitants,
    // required this.changeMainRenter,
    required this.changeInfo,
    required this.getCheckInInfo,
    required super.child,
  });

  // 入住详情
  final Map info;
  final Map mainRenter;
  final List cohabitants;
  // 修改入住详情
  final Function changeInfo;
  final Function getCheckInInfo;
  // final Function changeMainRenter;

  static CheckInInfoState? of(BuildContext context) {
    final checkInInfo =
        context.dependOnInheritedWidgetOfExactType<CheckInInfoState>();
    // 安全检查
    assert(checkInInfo != null, "No CheckInInfoState found in context");

    return checkInInfo;
  }


  @override
  bool updateShouldNotify(CheckInInfoState oldWidget) {
    return info != oldWidget.info;
  }

}